<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>成绩排名</title>
</head>

<body>
    <script>
        function score() {
            let arr = [
                { name: '张三', score: 99, sex: '男' },
                { name: '李四', score: 100, sex: '男' },
                { name: '王武', score: 77, sex: '女' },
                { name: '张红', score: 68, sex: '男' }
            ]
            let num = arr[0].score
            for (let i = 1; i < arr.length; i++) {
                console.log(num);
                arr[i].score > num ? num = arr[i].score : num
            }
            for (let i = 0; i < arr.length; i++) {
                if (num === arr[i].score) {
                    console.log(arr[i])
                }
            }

        }
        score()


    </script>
</body>

</html>